3.8.91 \(\int \frac {(d \cot (e+f x))^n}{a+i a \tan (e+f x)} \, dx\) [791]

Optimal. Leaf size=157 \[ -\frac {(d \cot (e+f x))^{2+n}}{2 d^2 f (i a+a \cot (e+f x))}-\frac {i n (d \cot (e+f x))^{2+n} \, _2F_1\left (1,\frac {2+n}{2};\frac {4+n}{2};-\cot ^2(e+f x)\right )}{2 a d^2 f (2+n)}+\frac {(1+n) (d \cot (e+f x))^{3+n} \, _2F_1\left (1,\frac {3+n}{2};\frac {5+n}{2};-\cot ^2(e+f x)\right )}{2 a d^3 f (3+n)} \]

[Out]

-1/2*(d*cot(f*x+e))^(2+n)/d^2/f/(I*a+a*cot(f*x+e))-1/2*I*n*(d*cot(f*x+e))^(2+n)*hypergeom([1, 1+1/2*n],[2+1/2*
n],-cot(f*x+e)^2)/a/d^2/f/(2+n)+1/2*(1+n)*(d*cot(f*x+e))^(3+n)*hypergeom([1, 3/2+1/2*n],[5/2+1/2*n],-cot(f*x+e
)^2)/a/d^3/f/(3+n)

________________________________________________________________________________________

Rubi [A]
time = 0.20, antiderivative size = 157, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {3754, 3633, 3619, 3557, 371} \begin {gather*} \frac {(n+1) (d \cot (e+f x))^{n+3} \, _2F_1\left (1,\frac {n+3}{2};\frac {n+5}{2};-\cot ^2(e+f x)\right )}{2 a d^3 f (n+3)}-\frac {i n (d \cot (e+f x))^{n+2} \, _2F_1\left (1,\frac {n+2}{2};\frac {n+4}{2};-\cot ^2(e+f x)\right )}{2 a d^2 f (n+2)}-\frac {(d \cot (e+f x))^{n+2}}{2 d^2 f (a \cot (e+f x)+i a)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d*Cot[e + f*x])^n/(a + I*a*Tan[e + f*x]),x]

[Out]

-1/2*(d*Cot[e + f*x])^(2 + n)/(d^2*f*(I*a + a*Cot[e + f*x])) - ((I/2)*n*(d*Cot[e + f*x])^(2 + n)*Hypergeometri
c2F1[1, (2 + n)/2, (4 + n)/2, -Cot[e + f*x]^2])/(a*d^2*f*(2 + n)) + ((1 + n)*(d*Cot[e + f*x])^(3 + n)*Hypergeo
metric2F1[1, (3 + n)/2, (5 + n)/2, -Cot[e + f*x]^2])/(2*a*d^3*f*(3 + n))

Rule 371

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*((c*x)^(m + 1)/(c*(m + 1)))*Hyperg
eometric2F1[-p, (m + 1)/n, (m + 1)/n + 1, (-b)*(x^n/a)], x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rule 3557

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[b/d, Subst[Int[x^n/(b^2 + x^2), x], x, b*Tan[c + d
*x]], x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rule 3619

Int[((b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*T
an[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Tan[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x] && NeQ
[c^2 + d^2, 0] &&  !IntegerQ[2*m]

Rule 3633

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-a
)*((c + d*Tan[e + f*x])^(n + 1)/(2*f*(b*c - a*d)*(a + b*Tan[e + f*x]))), x] + Dist[1/(2*a*(b*c - a*d)), Int[(c
 + d*Tan[e + f*x])^n*Simp[b*c + a*d*(n - 1) - b*d*n*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x
] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] &&  !GtQ[n, 0]

Rule 3754

Int[(cot[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_.))^(p_.), x_Symbol] :> Dist
[d^(n*p), Int[(d*Cot[e + f*x])^(m - n*p)*(b + a*Cot[e + f*x]^n)^p, x], x] /; FreeQ[{a, b, d, e, f, m, n, p}, x
] &&  !IntegerQ[m] && IntegersQ[n, p]

Rubi steps

\begin {align*} \int \frac {(d \cot (e+f x))^n}{a+i a \tan (e+f x)} \, dx &=\frac {\int \frac {(d \cot (e+f x))^{1+n}}{i a+a \cot (e+f x)} \, dx}{d}\\ &=-\frac {(d \cot (e+f x))^{2+n}}{2 d^2 f (i a+a \cot (e+f x))}-\frac {\int (d \cot (e+f x))^{1+n} (-i a d n+a d (1+n) \cot (e+f x)) \, dx}{2 a^2 d^2}\\ &=-\frac {(d \cot (e+f x))^{2+n}}{2 d^2 f (i a+a \cot (e+f x))}+\frac {(i n) \int (d \cot (e+f x))^{1+n} \, dx}{2 a d}-\frac {(1+n) \int (d \cot (e+f x))^{2+n} \, dx}{2 a d^2}\\ &=-\frac {(d \cot (e+f x))^{2+n}}{2 d^2 f (i a+a \cot (e+f x))}-\frac {(i n) \text {Subst}\left (\int \frac {x^{1+n}}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{2 a f}+\frac {(1+n) \text {Subst}\left (\int \frac {x^{2+n}}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{2 a d f}\\ &=-\frac {(d \cot (e+f x))^{2+n}}{2 d^2 f (i a+a \cot (e+f x))}-\frac {i n (d \cot (e+f x))^{2+n} \, _2F_1\left (1,\frac {2+n}{2};\frac {4+n}{2};-\cot ^2(e+f x)\right )}{2 a d^2 f (2+n)}+\frac {(1+n) (d \cot (e+f x))^{3+n} \, _2F_1\left (1,\frac {3+n}{2};\frac {5+n}{2};-\cot ^2(e+f x)\right )}{2 a d^3 f (3+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [F]
time = 2.80, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(d \cot (e+f x))^n}{a+i a \tan (e+f x)} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

Integrate[(d*Cot[e + f*x])^n/(a + I*a*Tan[e + f*x]),x]

[Out]

Integrate[(d*Cot[e + f*x])^n/(a + I*a*Tan[e + f*x]), x]

________________________________________________________________________________________

Maple [F]
time = 0.83, size = 0, normalized size = 0.00 \[\int \frac {\left (d \cot \left (f x +e \right )\right )^{n}}{a +i a \tan \left (f x +e \right )}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*cot(f*x+e))^n/(a+I*a*tan(f*x+e)),x)

[Out]

int((d*cot(f*x+e))^n/(a+I*a*tan(f*x+e)),x)

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))^n/(a+I*a*tan(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is undefined.

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))^n/(a+I*a*tan(f*x+e)),x, algorithm="fricas")

[Out]

integral(1/2*((I*d*e^(2*I*f*x + 2*I*e) + I*d)/(e^(2*I*f*x + 2*I*e) - 1))^n*(e^(2*I*f*x + 2*I*e) + 1)*e^(-2*I*f
*x - 2*I*e)/a, x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {i \int \frac {\left (d \cot {\left (e + f x \right )}\right )^{n}}{\tan {\left (e + f x \right )} - i}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))**n/(a+I*a*tan(f*x+e)),x)

[Out]

-I*Integral((d*cot(e + f*x))**n/(tan(e + f*x) - I), x)/a

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))^n/(a+I*a*tan(f*x+e)),x, algorithm="giac")

[Out]

integrate((d*cot(f*x + e))^n/(I*a*tan(f*x + e) + a), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (d\,\mathrm {cot}\left (e+f\,x\right )\right )}^n}{a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*cot(e + f*x))^n/(a + a*tan(e + f*x)*1i),x)

[Out]

int((d*cot(e + f*x))^n/(a + a*tan(e + f*x)*1i), x)

________________________________________________________________________________________